﻿<UserControl x:Class="SoftTeach.View.Noten.NotenlisteDetailPrintView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
             Name="ParentUserControl"
             mc:Ignorable="d" Width="750" Height="300">
  <UserControl.Resources>
    <CollectionViewSource x:Key="SortedSchüler" Source="{Binding Schülereinträge}">
      <CollectionViewSource.SortDescriptions>
        <scm:SortDescription PropertyName="SchülereintragPerson.PersonNachname" Direction="Ascending" />
        <scm:SortDescription PropertyName="SchülereintragPerson.PersonVorname" Direction="Ascending" />
      </CollectionViewSource.SortDescriptions>
    </CollectionViewSource>
  </UserControl.Resources>
  <Grid Margin="60,60">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <Grid Grid.Row="0" Margin="5">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>
      <Label Grid.Row="0" Style="{StaticResource StundenentwurfPrintHeaderLabelBold}" Content="{Binding Path=NotenlisteTitel, Mode=OneWay}"/>
    </Grid>
    <DataGrid Grid.Row="2" Name="PhasenTable" Margin="5"
              Style="{StaticResource DatagridPrintStyle}"
              ItemsSource="{Binding Source={StaticResource SortedSchüler}}"
              IsReadOnly="True"
              AutoGenerateColumns="False"
              RowDetailsVisibilityMode="Collapsed" 
              HorizontalScrollBarVisibility="Disabled" 
              VerticalScrollBarVisibility="Disabled"
              HeadersVisibility="Column"
              Width="571">
      <DataGrid.Columns>
        <DataGridTextColumn Header="Nachname" Binding="{Binding Path=SchülereintragPerson.PersonNachname}" Width="160"/>
        <DataGridTextColumn Header="Vorname" Binding="{Binding Path=SchülereintragPerson.PersonVorname}" Width="160"/>
        <DataGridTextColumn Header="Qualität" Binding="{Binding Path=MündlicheQualitätNote}" Width="62" CellStyle="{StaticResource CenteredCellPrintStyle}"/>
        <DataGridTextColumn Header="Quantität" Binding="{Binding Path=MündlicheQuantitätNote}" Width="63" CellStyle="{StaticResource CenteredCellPrintStyle}"/>
        <DataGridTextColumn Header="Schriftlich" Binding="{Binding Path=SchriftlicheGesamtNote}" Width="63" CellStyle="{StaticResource CenteredCellPrintStyle}"/>
        <DataGridTextColumn Header="Gesamt" Binding="{Binding Path=Gesamtnote}" Width="63" CellStyle="{StaticResource CenteredCellPrintStyle}"/>
      </DataGrid.Columns>
    </DataGrid>
  </Grid>
</UserControl>
